/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 50717
 Source Host           : localhost:3306
 Source Schema         : cloud_security

 Target Server Type    : MySQL
 Target Server Version : 50717
 File Encoding         : 65001

 Date: 12/04/2021 15:30:42
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for oauth_permission
-- ----------------------------
DROP TABLE IF EXISTS `oauth_permission`;
CREATE TABLE `oauth_permission`  (
  `permission_id` int(11) NOT NULL AUTO_INCREMENT,
  `permission_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '资源名称',
  `permission_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '资源路径(当资源是权限是就是接口地址，当是菜单栏时是页面地址)',
  `permission_parent_id` int(11) UNSIGNED ZEROFILL NULL DEFAULT NULL COMMENT '父节点',
  `permission_type` int(10) UNSIGNED ZEROFILL NULL DEFAULT NULL COMMENT '0-导航栏  1-按钮  2-其他',
  `permission_deleted` bit(1) NULL DEFAULT b'0' COMMENT '是否删除',
  `permission_authorization` bit(1) NULL DEFAULT b'0' COMMENT '是否需要权限',
  `permission_icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图标',
  PRIMARY KEY (`permission_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 75 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '资源表';

-- ----------------------------
-- Records of oauth_permission
-- ----------------------------
BEGIN;
INSERT INTO `oauth_permission` VALUES (40, '主页', '/page/home.html', 00000000000, 0000000000, b'0', b'0', 'layui-icon-home'), (41, '预览代码生成', '/generator/prev', 00000000044, 0000000001, b'0', b'0', ''), (42, '获取数据源信息', '/generator/getDataSource', 00000000044, 0000000001, b'1', b'0', ''), (43, '系统管理', '', 00000000000, 0000000000, b'0', b'0', 'layui-icon-chart-screen'), (44, '代码生成', '/page/system/generator.html', 00000000043, 0000000000, b'0', b'0', 'layui-icon-file-b'), (45, '获取权限服务器所有表', '/generator/getAuthTableInfo', 00000000000, 0000000001, b'1', b'0', NULL), (46, '测试菜单', 'test1', 00000000043, 0000000000, b'1', b'0', 'layui-icon-heart'), (47, '资源管理', '/page/system/permission.html', 00000000043, 0000000000, b'0', b'0', 'layui-icon-auz'), (48, '其它', '', 00000000000, 0000000000, b'0', b'0', 'layui-icon-senior'), (49, '图标展示', '/page/other/icon.html', 00000000048, 0000000000, b'0', b'0', 'layui-icon-list'), (50, '图标管理', '/page/other/iconManager.html', 00000000048, 0000000000, b'0', b'0', 'layui-icon-set-sm'), (51, '测试子节点', '/teste', 00000000000, 0000000000, b'1', b'0', 'layui-icon-windows'), (53, '下载代码', '/generator/download', 00000000044, 0000000001, b'0', b'1', 'layui-icon-download-circle'), (54, '用户管理', '/page/system/oauthUser.html', 00000000043, 0000000000, b'0', b'0', 'layui-icon-user'), (55, '管理用户角色', '/auth/oauthUser/resetUserRole', 00000000054, 0000000001, b'0', b'0', 'layui-icon-set'), (56, '角色管理', '/page/system/oauthRole.html', 00000000043, 0000000000, b'0', b'0', 'layui-icon-friends'), (57, '删除用户', '/oauthUser/deleteData', 00000000054, 0000000001, b'0', b'1', 'layui-icon-delete'), (58, '添加用户', '/auth/oauthUser/insertData', 00000000054, 0000000001, b'0', b'1', 'layui-icon-add-1'), (59, '修改用户信息', '/auth/oauthUser/updateData', 00000000054, 0000000001, b'0', b'1', 'layui-icon-set'), (60, '添加图标', '/icon/addIcon', 00000000050, 0000000001, b'0', b'1', 'layui-icon-add-1'), (61, '添加资源', '/oauthPermission/addPermission', 00000000047, 0000000001, b'0', b'1', 'layui-icon-add-1'), (62, '删除权限', '/oauthPermission/deletePermission', 00000000047, 0000000001, b'0', b'1', 'layui-icon-delete'), (63, '修改权限', '/oauthPermission/editPermission', 00000000047, 0000000001, b'0', b'1', 'layui-icon-set'), (64, '添加角色', '/auth/oauthRole/insertData', 00000000056, 0000000001, b'0', b'1', 'layui-icon-add-1'), (65, '删除角色', '/auth/oauthRole/deleteData', 00000000056, 0000000001, b'0', b'1', 'layui-icon-delete'), (66, '修改角色信息', '/auth/oauthRole/updateData', 00000000056, 0000000001, b'0', b'1', 'layui-icon-set'), (67, '设置角色对应权限', '/auth/oauthRole/resetRolePermissions', 00000000056, 0000000001, b'0', b'1', 'layui-icon-set-sm'), (68, '博客管理', '', 00000000000, 0000000000, b'0', b'0', 'layui-icon-heart-fill'), (69, '博客信息', '/page/blog/blogManager.html', 00000000068, 0000000000, b'0', b'0', 'layui-icon-form'), (70, '查看当前用户及拥有的权限', '/auth/oauthUser/currentUser/true', 00000000054, 0000000001, b'0', b'1', 'layui-icon-auz'), (71, 'test01', '/test/test01', 00000000068, 0000000001, b'0', b'0', 'layui-icon-auz'), (72, '修改图标', '/icon/editIcon', 00000000047, 0000000001, b'0', b'1', 'layui-icon-set'), (73, '博客标签', '/page/blog/blogLabels.html', 00000000068, 0000000000, b'0', b'1', 'layui-icon-note'), (74, '博客分类', '/page/blog/blogSorts.html', 00000000068, 0000000000, b'0', b'1', 'layui-icon-templeate-1');
COMMIT;

-- ----------------------------
-- Table structure for oauth_role
-- ----------------------------
DROP TABLE IF EXISTS `oauth_role`;
CREATE TABLE `oauth_role`  (
  `role_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `role_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '角色的名称',
  `role_remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '描述',
  `role_create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '角色创建时间',
  PRIMARY KEY (`role_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色表';

-- ----------------------------
-- Records of oauth_role
-- ----------------------------
BEGIN;
INSERT INTO `oauth_role` VALUES (6, '用户', '普通用户', '2020-06-08 05:19:52'), (7, '管理员', '操作后台', '2020-06-08 05:20:22'), (8, '普通用户', '测试普通用户', '2020-07-10 14:22:19');
COMMIT;

-- ----------------------------
-- Table structure for oauth_role_permission
-- ----------------------------
DROP TABLE IF EXISTS `oauth_role_permission`;
CREATE TABLE `oauth_role_permission`  (
  `role_permission_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `permission_id` int(11) NULL DEFAULT NULL COMMENT '资源id',
  `role_id` int(11) NULL DEFAULT NULL COMMENT '角色id',
  PRIMARY KEY (`role_permission_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 213 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色资源关联表';

-- ----------------------------
-- Records of oauth_role_permission
-- ----------------------------
BEGIN;
INSERT INTO `oauth_role_permission` VALUES (183, 40, 7), (184, 41, 7), (185, 43, 7), (186, 44, 7), (187, 47, 7), (188, 48, 7), (189, 50, 7), (190, 53, 7), (191, 54, 7), (192, 55, 7), (193, 56, 7), (194, 57, 7), (195, 58, 7), (196, 59, 7), (197, 60, 7), (198, 61, 7), (199, 62, 7), (200, 63, 7), (201, 64, 7), (202, 65, 7), (203, 66, 7), (204, 67, 7), (205, 70, 7), (206, 40, 6), (207, 43, 6), (208, 47, 6), (209, 63, 6), (210, 40, 8), (211, 71, 7), (212, 71, 8);
COMMIT;

-- ----------------------------
-- Table structure for oauth_user
-- ----------------------------
DROP TABLE IF EXISTS `oauth_user`;
CREATE TABLE `oauth_user`  (
  `user_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `user_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户名称',
  `user_phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机号',
  `user_address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '地址',
  `user_enabled` bit(1) NULL DEFAULT b'1' COMMENT '是否启用',
  `user_number` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '账号',
  `user_password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '密码',
  `user_remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '描述',
  `user_openid` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '微信登陆获取的信息',
  `user_sex` int(11) NULL DEFAULT 0 COMMENT '值为1时是男性，值为2时是女性，值为0时是未知',
  `user_birth_day` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '用户生日',
  `user_province` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '省份',
  `user_city` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '城市',
  `user_head_image` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '头像',
  `user_create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '用户创建时间',
  PRIMARY KEY (`user_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户表';

-- ----------------------------
-- Records of oauth_user
-- ----------------------------
BEGIN;
INSERT INTO `oauth_user` VALUES (5, '测试', '123', '1', b'1', '123', '$2a$10$fGZ6khtkI/qrFX2BtQLZcObAzRIF3MTD3jZ28QLERjstvj4PosOYm', '1', '1', 1, '2020-06-08 04:43:05', '0', '0', '1', '2020-06-08 04:43:05'), (6, '测试账户2', '17683906991', '测试地址', b'1', 'admin', '$2a$10$fGZ6khtkI/qrFX2BtQLZcObAzRIF3MTD3jZ28QLERjstvj4PosOYm', '测试账户', NULL, 2, '2020-07-07 16:00:00', NULL, NULL, NULL, '2020-07-08 16:58:13'), (7, '李旭', '12345678911', '住址', b'1', 'lixu', '$2a$10$/i.0SAtSXy/2JiWexLUop.3pO/1wttVD4VF0wwhtuJA/vVZlyilHK', 'fake news', NULL, 1, '2020-10-18 16:00:00', NULL, NULL, NULL, '2020-10-19 17:57:52');
COMMIT;

-- ----------------------------
-- Table structure for oauth_user_role
-- ----------------------------
DROP TABLE IF EXISTS `oauth_user_role`;
CREATE TABLE `oauth_user_role`  (
  `user_role_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `user_id` int(11) NULL DEFAULT NULL COMMENT '用户id',
  `role_id` int(11) NULL DEFAULT NULL COMMENT '角色id',
  PRIMARY KEY (`user_role_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户角色管理表';

-- ----------------------------
-- Records of oauth_user_role
-- ----------------------------
BEGIN;
INSERT INTO `oauth_user_role` VALUES (8, 5, 7), (10, 6, 6), (11, 7, 8);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
